<?php
/**
 * @file
 * Facebook's JavaScript for iframe resizing.
 *
 * Resize iframe after loading a page to eliminate internal vertical scrollbar.
 *
 * Usage:
 *  - A JavaScript block that wants to resize the iframe should include/require
 *    this page once and only once. (Note: There may be many JavaScript blocks
 *    in a page. Thus, it is more correct to use 'include'/'require' rather than
 *    'include_once'/'require_once'.)
 *  - This page must be either embedded within a JavaScript block or placed
 *    within the '<script></script>' tags if it is used on its own.
 *  - The JavaScript block in which this page is inserted must be executed.
 *    (E.g. If this page is inserted within a JavaScript function, that
 *    JavaScript function must be called to achieve iframe resizing.)
 *  - The 'FBJS Feature Loader' must be loaded before executing this JavaScript.
 *  - 'fb_iframe_resize_div.php' must be used in the page needing the iframe
 *    resizing.
 *
 * Parameter(s):
 *  - $PATH_COMMON : Relative path from the calling page to the 'common'
 *                   directory (e.g. '../common/').
 *
 * Global variable(s) set:
 *  - None.
 *
 * Global variable(s) unset:
 *  - None.
 *
 * Exception(s):
 *  - None.
 *
 * This file includes/requires:
 *  - h_facebook.php
 */

// header file(s) ==============================================================
require_once $PATH_COMMON . "php/h_facebook.php";


// implementation ==============================================================
?>
FB_RequireFeatures(
  ["CanvasUtil"],
  function() {
    FB.XdComm.Server.init("<?php echo FB_JS_XDOMAIN_RECEIVER ?>");
    FB.CanvasClient.startTimerToSizeToContent();
  }
);
